package com.lxitedu.chain.processor;

import com.lxitedu.dao.impl.ibatis.EmailDataDaoImpl;
import com.lxitedu.utils.Context;
import com.lxitedu.utils.LxitException;

public class Main {

  public static void main(String[] args) {
    Chain createTableChain = new CreateTableChain();
    Chain createThreadPoolChain = new CreateThreadPoolChain();
    Chain dispatchThreadChain = new DispatchThreadChain();
    createTableChain.setNext(createThreadPoolChain);
    createThreadPoolChain.setNext(dispatchThreadChain);
    Context context = new Context();
    context.getValueMap().put("tableName", "csdn");
    //context.getValueMap().put("maxThreadNumber", 10);
    context.getUrlList().add("http://www.csdn.com");
    context.setEmailDataDao(new EmailDataDaoImpl());
    try {
      createTableChain.process(context);
    } catch (LxitException e) {
      e.printStackTrace();
    }
  }

}
